package org.example.platform.design.zerenlian;


/**
 * 责任链模式
 */
public class Test {


    public static void main(String[] args) {

//        System.out.println("------------------------------------------------");
//        manager jl = new manager("经理");
//        manager zj = new manager("总监");
//        manager zjl = new manager("总经理");
//
//        Request request = new Request();
//        request.setType("加薪");
//        request.setNum(600);
//        request.setContent("小菜请求加薪");
//
//        jl.getResult("经理",request);
//        zj.getResult("总监",request);
//        zjl.getResult("总经理",request);
//
//        System.out.println("------------------------------------------------");
//
//        Request request2 = new Request();
//        request2.setType("请假");
//        request2.setNum(6);
//        request2.setContent("小菜请假");
//
//        jl.getResult("经理",request2);
//        zj.getResult("总监",request2);
//        zjl.getResult("总经理",request2);
//
//        System.out.println("------------------------------------------------");


        System.out.println("------------------------------------------------");
        Jl jl = new Jl("经理");
        Zj zj = new Zj("总监");
        Zjl zjl = new Zjl("总经理");
        jl.setManager(zj);
        zj.setManager(zjl);

        Request request2 = new Request();
        request2.setType("请假");
        request2.setNum(6);
        request2.setContent("小菜请假");
        jl.getResult(request2);

        System.out.println("------------------------------------------------");

        Request request = new Request();
        request.setType("加薪");
        request.setNum(600);
        request.setContent("小菜请求加薪");
        jl.getResult(request);

        System.out.println("------------------------------------------------");

    }
}
